/*
 * Copyright (C) 2009 Rob Cash
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * SubscriptionStore.java
 * 
 * Created on Jan 5, 2009 at 8:09:41 AM
 */

package org.robcash.apps.messagepopup.vo;

import java.net.URI;
import java.util.List;
import org.robcash.apps.messagepopup.MessageException;

/**
 *
 * @author Rob
 */
public interface SubscriptionStore {

    /**
     * Get the location of the store
     * @return Store location
     */
    public URI getLocation();

    /**
     * Get the schedules
     * @return Schedules
     */
    public List<Schedule> getSchedules();

    /**
     * Add a schedule
     * @param schedule Schedule to add
     */
    public void add(Schedule schedule);

    /**
     * Remove a schedule
     * @param schedule Schedule to remove
     */
    public void remove(Schedule schedule);

    /**
     * Clear all schedules and subscriptions
     */
    public void clear();

    /**
     * Get the subscriptions
     * @return Subscriptions
     */
    public List<Subscription> getSubscriptions();

    /**
     * Add a subscription
     * @param subscription Subscription to add
     */
    public void add(Subscription subscription);

    /**
     * Remove a subscription
     * @param subscription Subscription to remove
     */
    public void remove(Subscription subscription);

    /**
     * Save the subscription store
     * @throws MessageException Thrown if store cannot be saved
     */
    public void save() throws MessageException;

}
